<template>
	<view class="u-page">
		<u-navbar
			:safeAreaInsetTop="false"
			title=""
			leftIconColor="#fff"
			bgColor="none"
			:fixed="true"
			:autoBack="true"
			leftText="平台设置"
		></u-navbar></u-list>
		<view class="empty-select">
			<u-cell
				:titleStyle="{fontWeight: 500}"
				@click="openImg(item.imgName)"
				:title="item.title"
				v-for="(item, index) in list"
				:key="index"
				isLink
			>
			</u-cell>
		</view>
		<view class="main_about_foot">
			<view class="foot_left">联系我们</view>
			<view class="foot_right" @click="goPhone(13800138000)">
				<u-icon name="phone" color="#fff" size="32"></u-icon>
			</view>
		</view>
	</view>
</template>

<script>
	import util from "@/utils/utils.js"
	export default {
		data() {
			return {
				list: [{
						imgName: 1,
						title: '操作流程',
					},
					{
						imgName: 2,
						title: '线下加急招聘服务',
					}, {
						imgName: 3,
						title: '投诉与建议',
					}, {
						imgName: 4,
						title: '修改密码',
					}, {
						imgName: 5,
						title: '退出登录',
					},
				]

			}
		},
		methods: {
			//点击改变图片
			openImg(imgName) {
				this.mode = imgName;
				switch(imgName){
					case 1:
						this.goto('/pages/article/caozuo')
						break;
					case 2:
						this.goto('/pages/form/job')
						break;
					case 3:
						this.goto('/pages/form/feedback')
						break;
					case 4:
						this.goto('/pages/form/password')
						break;
					case 5:
						this.outlogin()
						break;
					default:
						//如果表达式的值和以上的case后面的值都没有匹配上，那么就执行这里的代码。
						break;
				}
			},
			
			//退出登录
			outlogin(){
				let that = this
				uni.showModal({
					title: '提示',
					content: '确定要退出账号吗？',
					success: function (res) {
						if (res.confirm) {
							util.clear()
							uni.redirectTo({
								url: '/pages/login/login'
							});
						} else if (res.cancel) {
							console.log('用户点击取消');
						}
					}
				});
			},
			goto(tourl) {
				uni.navigateTo({
					url: tourl
				});
			}
		}
	}
</script>

<style lang="scss">
	.u-page {
		padding: 40rpx 0px;

		&__top-box {
			padding-left: 40rpx;
		}
	}

	.empty-select {
		margin-top: 100rpx;
	}
	
	
	.main_about_foot{
		width: 100%;
		display: flex;
		align-items: center;
		color: #fff;
		position: fixed;
		bottom: 0;
		.foot_left{
			background-color: #795fff;
			width: 50%;
			height:140rpx;
			line-height: 140rpx;
			display: flex;
			justify-content: center;
		}
		.foot_right{
			background-color: #000;
			width: 50%;
			height:140rpx;
			line-height: 140rpx;
			display: flex;
			justify-content: center;
		}
	}
</style>